function struct2csv(s,file)
% STRUCT2CSV write struct s to csv file
    tab = struct2table(s);
    writetable(tab,file);
end